﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    mc:Ignorable="d">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Icons.xaml" />
        <ResourceDictionary Source="../Converters.xaml" />
        <ResourceDictionary Source="Brushes.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <Style x:Key="style_button_close" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource COLOR_DARKGRAY}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Grid Background="White" Opacity="0" />
                        <Path Width="12"
                              Height="12"
                              Margin="6"
                              Data="F1M54.0573,47.8776L38.1771,31.9974 54.0547,16.1198C55.7604,14.4141 55.7604,11.6511 54.0573,9.94531 52.3516,8.23962 49.5859,8.23962 47.8802,9.94531L32.0026,25.8229 16.1224,9.94531C14.4167,8.23962 11.6511,8.23962 9.94794,9.94531 8.24219,11.6511 8.24219,14.4141 9.94794,16.1198L25.8255,32 9.94794,47.8776C8.24219,49.5834 8.24219,52.3477 9.94794,54.0534 11.6511,55.7572 14.4167,55.7585 16.1224,54.0534L32.0026,38.1745 47.8802,54.0534C49.5859,55.7585 52.3516,55.7572 54.0573,54.0534 55.7604,52.3477 55.763,49.5834 54.0573,47.8776z"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="true" />
                                <Condition Property="IsMouseOver" Value="true" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter Property="Foreground" Value="Black" />
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource COLOR_DARKGRAY}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="style_button_min" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource COLOR_DARKGRAY}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Grid Background="White" Opacity="0" />
                        <Path Width="12"
                              Height="12"
                              Margin="6"
                              Data="M0,0L53.333,0 53.333,8.888 0,8.888z"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Button">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Grid Background="White" Opacity="0" />
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1">
                            <Label Margin="12,0"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Center"
                                   Content="{TemplateBinding Content}"
                                   Foreground="{TemplateBinding Foreground}" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Foreground" Value="OrangeRed" />
                            <Setter Property="BorderBrush" Value="OrangeRed" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="Gray" />
                            <Setter Property="BorderBrush" Value="Gray" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="style_button_next" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource COLOR_BLUE}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Grid Background="White" Opacity="0" />
                        <Path Width="20"
                              Height="20"
                              Margin="6"
                              Data="F1M-756.543,-2951.94L-775.412,-2933.06 -775.278,-2932.93 -765.046,-2932.93 -747.577,-2950.4 -742.327,-2955.65 -764.908,-2978.23 -775.412,-2978.23 -756.543,-2959.36 -806.328,-2959.36 -806.328,-2951.94 -756.543,-2951.94z"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Foreground" Value="{StaticResource COLOR_ORANGERED}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource COLOR_DARKGRAY}" />
                        </Trigger>
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="style_button_previous" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource COLOR_BLUE}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Grid Background="White" Opacity="0" />
                        <Path Width="20"
                              Height="20"
                              Margin="6"
                              Data="F1M-800.86,-1379.55L-781.99,-1360.68 -782.125,-1360.54 -792.356,-1360.54 -809.825,-1378.01 -815.075,-1383.26 -792.494,-1405.84 -781.99,-1405.84 -800.86,-1386.97 -751.074,-1386.97 -751.074,-1379.55 -800.86,-1379.55z"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Foreground" Value="{StaticResource COLOR_ORANGERED}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource COLOR_DARKGRAY}" />
                        </Trigger>
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CheckButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Fill="White" Opacity="0" />
                        <Path Width="{TemplateBinding Width}"
                              Height="{TemplateBinding Height}"
                              Margin="0,0,0,0"
                              Data="{Binding Source={StaticResource ICON_CHECK},
                                             Converter={StaticResource StringToPathGeometryConverter}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CrossButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Fill="White" Opacity="0" />
                        <Path Width="{TemplateBinding Width}"
                              Height="{TemplateBinding Height}"
                              Margin="0,0,0,0"
                              Data="{Binding Source={StaticResource ICON_CLOSE},
                                             Converter={StaticResource StringToPathGeometryConverter}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="EditButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Fill="White" Opacity="0" />
                        <Path Width="{TemplateBinding Width}"
                              Height="{TemplateBinding Height}"
                              Margin="0,0,0,0"
                              Data="{Binding Source={StaticResource ICON_EDIT},
                                             Converter={StaticResource StringToPathGeometryConverter}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DeleteButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Fill="White" Opacity="0" />
                        <Path Width="16"
                              Height="16"
                              Margin="0,0,0,0"
                              Data="{Binding Source={StaticResource ICON_GARBAGE},
                                             Converter={StaticResource StringToPathGeometryConverter}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="FirstPageButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="25" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Background" Value="{StaticResource GrayBrush3}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.4"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.6"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.2"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>


                        <Grid Width="8"
                              Height="9"
                              Opacity="0.7">
                            <Path Width="5"
                                  Height="9"
                                  HorizontalAlignment="Right"
                                  Data="M0,1 L1,0 L1,2 Z"
                                  Fill="{StaticResource CheckBoxMouseOverBrush}"
                                  Stretch="Fill" />
                            <Rectangle Width="2"
                                       HorizontalAlignment="Left"
                                       Fill="{StaticResource CheckBoxMouseOverBrush}" />
                        </Grid>
                        <Ellipse x:Name="ellipse"
                                 Fill="Transparent"
                                 Opacity="0.3"
                                 Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="PreviousPageButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="25" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Background" Value="{StaticResource GrayBrush3}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.4"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.6"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.2"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Path Width="5"
                              Height="9"
                              HorizontalAlignment="Center"
                              Data="M0,1 L1,0 L1,2 Z"
                              Fill="{StaticResource CheckBoxMouseOverBrush}"
                              Opacity="0.7"
                              Stretch="Fill" />
                        <Ellipse x:Name="ellipse"
                                 Fill="Transparent"
                                 Opacity="0.3"
                                 Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NextPageButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="25" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Background" Value="{StaticResource GrayBrush3}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.4"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.6"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.2"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>


                        <Path Width="5"
                              Height="9"
                              HorizontalAlignment="Center"
                              Data="M0,0 L1,1 L0,2 Z"
                              Fill="{StaticResource CheckBoxMouseOverBrush}"
                              Opacity="0.7"
                              Stretch="Fill" />
                        <Ellipse x:Name="ellipse"
                                 Fill="Transparent"
                                 Opacity="0.3"
                                 Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="LastPageButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="25" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Background" Value="{StaticResource GrayBrush3}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.4"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.6"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.2"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Grid Width="8"
                              Height="9"
                              Opacity="0.7">
                            <Path Width="5"
                                  Height="9"
                                  HorizontalAlignment="Left"
                                  Data="M0,0 L1,1 L0,2 Z"
                                  Fill="{StaticResource CheckBoxMouseOverBrush}"
                                  Stretch="Fill" />
                            <Rectangle Width="2"
                                       HorizontalAlignment="Right"
                                       Fill="{StaticResource CheckBoxMouseOverBrush}" />
                        </Grid>
                        <Ellipse x:Name="ellipse"
                                 Fill="Transparent"
                                 Opacity="0.3"
                                 Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="{StaticResource GrayBrush7}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="Padding" Value="5,6" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.7" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0.3" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusInnerRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource ControlsDisabledBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3" />
                        <Border x:Name="MouseOverBorder"
                                Background="{StaticResource GrayBrush8}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Border x:Name="PressedBorder"
                                Background="{StaticResource GrayBrush5}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Rectangle x:Name="FocusRectangle"
                                   Margin="-1"
                                   Opacity="0"
                                   RadiusX="4"
                                   RadiusY="4"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <ContentPresenter x:Name="contentPresenter"
                                          Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Content="{TemplateBinding Content}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>